----------------------------------------
1. DESCRIPTION

This is a replication folder for Eady (2016) "The Statistical Analysis of
Misreporting on Sensitive Survey Questions." All of the files, data, and code 
necessary to replicate the figures, simulation studies, and empirical results in 
the article are present in this folder.

Version: December 19, 2016


----------------------------------------
2. SIMULATION STUDIES

2.1. Data

To reproduce the simulation studies, change the paths as necessary in the 
following files and run each file to generate simulation data:

SimStudy1.R
SimStudy2.R
SimStudy3A.R
SimStudy3B.R

Each SimStudy*.R file was run 10 times to generate 10,000 simulations per study,
as described in the article. The simulated data that are used in the article are
available in the file SimStudyData.zip, which uncompresses to the directory
SimStudyData/.

** NOTE: The SimStudy*.R files take a substantial amount of time to execute and
were run on an MPI cluster with 64 nodes (8 cores per node, 512 CPU total cores)
over roughly 3-4 days.


2.2. Figures

After outputting the simulation data (or using the existing simulation data),
change the paths in SimStudyGraphs.R as necessary and run to generate the
figures found in the article.



----------------------------------------
3. EMPIRICAL APPLICATION

To reproduce the results, figures, and tables in the empirical application
section, uncompress ListGender.zip, change the paths as necessary in Empirics.R,
and run. 

** NOTE: The code for fitting Models 1 and 2, and that for the simulated
predicted probabilities in the Empirics.R file takes a substantial amount of
time to complete. The fitted models "model.1" and "model.2" are therefore also
provided as .rds objects, and are available to load in Empirics.R.



----------------------------------------
4. FILE MANIFEST

Simulations:

(1) SimStudy1.R      - Generates simulation data for Simulation Study 1
(2) SimStudy2.R      - Generates simulation data for Simulation Study 2
(3) SimStudy3A.R     - Generates simulation data for Simulation Study 3A
(4) SimStudy3B.R     - Generates simulation data for Simulation Study 3B
(5) SimStudyGraphs.R - Generates figures for simulation studies 1, 2, 3A, and 3B
(6) SimStudyData.zip - Simulation study data as generated through SimStudy1.R, 
                       SimStudy2.R, SimStudy3A.R, and SimStudy3B.R

Empirics:

(7) ListGender.csv/.zip - Empirical case-study data.
(8) Empirics.R          - Fits models for empirical application and generates
                          relevant figures and statistical output.
(9) Model1.rds          - Fitted model object for model.1 in Empirics.R
(10) Model2.rds         - Fitted model object for model.2 in Empirics.R

Functions:

(11) Functions.R - Functions to fit the proposed and standard model through EM
                  as described in the article.

Note that all simulation and empirical results in the article rely on the 
functions provided in Functions.R. These functions form the 
basis of the R package "misreport", which is available on the 
Comprehensive R Archive Network (CRAN) at:
https://cran.r-project.org/package=misreport.



----------------------------------------
5. R AND R PACKAGE VERSION INFORMATION

All results were obtained using the following R packages/versions:

R Session info:

setting  value
version  R version 3.3.0 (2016-05-03)
system   x86_64, darwin13.4.0
ui       AQUA
language (EN)
collate  en_US.UTF-8
tz       America/Toronto
date     2016-11-19

ggplot2     * 2.2.0    2016-11-11 CRAN (R 3.3.2)
gridExtra   * 2.2.1    2016-02-29 CRAN (R 3.3.0)
list        * 8.2      2016-08-16 CRAN (R 3.3.0)
mvtnorm     * 1.0-5    2016-02-02 CRAN (R 3.3.0)
numDeriv    * 2016.8-1 2016-08-27 CRAN (R 3.3.0)
reshape     * 0.8.5    2014-04-23 CRAN (R 3.3.0)
snow        * 0.4-1    2015-10-31 CRAN (R 3.3.0)
